<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            // 对象的合并
            let arr = [{ name: 'zs' }, { age: 18 }, { name: 'lisi' }];
            let value = arr.reduce((pre, cur) => {
                return { ...pre, ...cur };
            }, {});
            console.log(value);
        </script>
    </body>
</html>
